package cn.fjc920.siaa.activitys

import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import android.view.accessibility.AccessibilityEvent
import androidx.appcompat.app.AlertDialog
import androidx.core.view.AccessibilityDelegateCompat
import androidx.core.view.ViewCompat
import cn.fjc920.siaa.R
import cn.fjc920.siaa.activityutils.BaseActivity
import kotlinx.android.synthetic.main.activity_filter.*

/**
 *      描述：筛选工时
 *      作者：樊建财
 *      时间：2023-02-28
 */

class FilterActivity : BaseActivity() {

    private lateinit var context: Context

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_filter)

        init()
        initClick()
    }

    private fun init(){

        context = this
        setSupportActionBar(findViewById(R.id.filter_toolbar))
        supportActionBar!!.setDisplayHomeAsUpEnabled(true)
    }

    private fun initClick() {

        filter_toolbar.setNavigationOnClickListener {
            finish()
        }
        btn_filter.setOnClickListener {
            filterDialog()
        }
    }

    @SuppressLint("InflateParams")
    private fun filterDialog(){

        val view = layoutInflater.inflate(R.layout.dialog_filter,null)
        val fd = AlertDialog.Builder(context).run {
            setView(view)
            create()
            show()
        }
    }

    companion object{

        fun actionStart(context: Context){
            val intent = Intent(context,FilterActivity::class.java)
            context.startActivity(intent)
        }
    }
}